import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from 'vue-router'

// 引入组件
import LargeScreen from '../views/LargeScreen.vue'
import Login from '../views/Login.vue'
import Layout from '../views/Layout.vue'
import BusinessReport from '../views/work-order-statistics/BusinessReport.vue'
import VPNAuto from '../views/work-order-statistics/VPNAuto.vue'
import DocumentManagement from '../views/knowledge-base/DocumentManagement.vue'
import PersonalCollection from '../views/knowledge-base/PersonalCollection.vue'
import ProcessDetails from '../views/work-order-statistics/VPNAuto-children/ProcessDetails.vue'
import Events from '../views/cloud-shield-alarm/Events.vue'
import History from '../views/cloud-shield-alarm/History.vue'
import Statistics from '../views/cloud-shield-alarm/Statistics.vue'
import InspectionRecord from '../views/inspection-management/InspectionRecord.vue'
import InspectionResult from '../views/inspection-management/InspectionResult.vue'
import InspectionTask from '../views/inspection-management/InspectionTask.vue'
import OperationLog from '../views/Logs/OperationLog.vue'
import SystemLog from '../views/Logs/SystemLog.vue'
import RoleManagement from '../views/authority-management/RoleManagement.vue'
import UserManagement from '../views/authority-management/UserManagement.vue'
import SystemSettings from '../views/settings/SystemSettings.vue'
import IntelligentAssistant from '../views/settings/IntelligentAssistant.vue'
import UrbanBrain from '../views/settings/UrbanBrain.vue'
import TemplateManagement from '../views/knowledge-base/TemplateManagement.vue'
import OnlyOfficeEditor from '../views/OnlyOfficeEditor.vue'
// 定义路由
const routes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/large-screen',
    component: LargeScreen,
  },
  {
    path: '/login',
    component: Login,
  },
  {
    path: '/only-office-editor',
    component: OnlyOfficeEditor,
  },
  {
    path: '/layout',
    component: Layout,
    children: [
      {
        path: '/layout',
        redirect: '/business-report',
      },
      {
        path: '/business-report',
        component: BusinessReport,
      },
      {
        path: '/VPN-auto',
        component: VPNAuto,
      },
      {
        path: '/process-details',
        component: ProcessDetails,
      },
      {
        path: '/document-management',
        component: DocumentManagement,
      },
      {
        path: '/personal-collection',
        component: PersonalCollection,
      },
      {
        path: '/events',
        component: Events,
      },
      {
        path: '/history',
        component: History,
      },
      {
        path: '/statistics',
        component: Statistics,
      },
      {
        path: '/inspection-record',
        component: InspectionRecord,
      },
      {
        path: '/inspection-result',
        component: InspectionResult,
      },
      {
        path: '/inspection-task',
        component: InspectionTask,
      },
      {
        path: '/operation-log',
        component: OperationLog,
      },
      {
        path: '/system-log',
        component: SystemLog,
      },
      {
        path: '/role-management',
        component: RoleManagement,
      },
      {
        path: '/user-management',
        component: UserManagement,
      },
      {
        path: '/system-settings',
        component: SystemSettings,
      },
      {
        path: '/intelligent-assistant',
        component: IntelligentAssistant,
      },
      {
        path: '/urban-brain',
        component: UrbanBrain,
      },
      {
        path: '/template-management',
        component: TemplateManagement,
      },
    ],
  },
]

// 创建路由实例
const router = createRouter({
  history: createWebHashHistory(), // 使用 HTML5 的 history 模式
  routes,
})

export default router
